package com.anime.adapter;

import android.graphics.Color;

import androidx.annotation.Nullable;

import com.animes.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import model.AnimeYHChapterModel;

public  class YHAnimeSelectionAdapter  extends BaseQuickAdapter<AnimeYHChapterModel.DataBean.PlayUrlBean, BaseViewHolder> {
    private int index;

    public YHAnimeSelectionAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<AnimeYHChapterModel.DataBean.PlayUrlBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AnimeYHChapterModel.DataBean.PlayUrlBean item) {
        if(index ==helper.getAdapterPosition()){


            helper.setTextColor(R.id.tv_title, Color.parseColor("#FFC0CB"));
        }else {
            helper.setTextColor(R.id.tv_title, Color.parseColor("#000000"));

        }
        helper.setText(R.id.tv_title,item.getTitle());
    }


    public void setIndex(int index) {
        this.index = index ;

    }
}
